const EventEmitter = require('./events')
const util = require('util')


function Girl() { }
// 原型继承
util.inherits(Girl, EventEmitter)

const girl = new Girl()

const cry = (...args) => {
    console.log('哭', ...args)
}

girl.on('生气了', cry)
girl.on('生气了', (...args) => {
    console.log('逛街', ...args)
})

const eat = () => {
    console.log('吃')
}

girl.once('生气了',eat)

setTimeout(() => {
    girl.off('生气了',eat)
    girl.emit('生气了', 'a', 'b')
    // girl.off('生气了', cry)
    girl.emit('生气了', 'a', 'b')
}, 1000)
